#ifndef KCODE_KSOCKET_H
#define KCODE_KSOCKET_H

struct KSOCK_svr_opt {
	const char *addr;
	unsigned short port;
	int backlog;
};

struct KSOCK_cli_opt {
	const char *addr;
	unsigned short port;
};

typedef int KSOCK_fd;
#define	KSOCK_INADDR_ANY		"KSOCK_INADDR_ANY"

KSOCK_fd KSOCK_svr_listen_tcp(struct KSOCK_svr_opt *svr_opt);
KSOCK_fd KSOCK_svr_accept(KSOCK_fd fd);

KSOCK_fd KSOCK_cli_connect_tcp(struct KSOCK_cli_opt *cli_opt);

#endif
